function isDisable(el, binding) {
  const value = binding.value
  if (!value) return

  if (value === 'hidden') {
    el.setAttribute('disabled', '')
  }
}

const mounted = (el, binding) => {
  isDisable(el, binding)
}

const disableDirective = {
  mounted,
}

export const directive = (app) => {
  app.directive('disabled', disableDirective)
}
